import store from 'store'
const USER_KEY = 'user_key'
const SERVICER_KEY = 'servicer_key'
const ORDER_KEY = 'order_key'
const QUESTION_KEY = 'question_key'

export default {
    // 存入localStorage
    saveUser(user) {
        store.set(USER_KEY, user);
    },
    // 读取localStorage
    getUser() {
        return store.get(USER_KEY || {});
    },
    // 删除localStorage
    delUser() {
        store.remove(USER_KEY);
    },

    // 存入localStorage
    saveServicer(servicer) {
        store.set(SERVICER_KEY, servicer);
    },
    // 读取localStorage
    getServicer() {
        return store.get(SERVICER_KEY || {});
    },
    // 删除localStorage
    delServicer() {
        store.remove(SERVICER_KEY);
    },

    // 存入localStorage
    saveOrder(order) {
        store.set(ORDER_KEY, order);
    },
    // 读取localStorage
    getOrder() {
        return store.get(ORDER_KEY || {});
    },
    // 删除localStorage
    delOrder() {
        store.remove(ORDER_KEY);
    },

    // 存入localStorage
    saveQuestion(question) {
        store.set(QUESTION_KEY, question);
    },
    // 读取localStorage
    getQuestion() {
        return store.get(QUESTION_KEY || {});
    },
    // 删除localStorage
    delQuestion() {
        store.remove(QUESTION_KEY);
    }
}